home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / bloodbro.c < prev    next >
C/C++ Source or Header  |  2000-04-23  |  19KB  |  538 lines

  1. /**************************************************************************
  2. Blood Bros, West Story.
  3. TAD Corporation 1990/Datsu 1991
  4. 68000 + Z80 + YM3931 + YM3812
  5.  
  6. driver by Carlos A. Lozano Baides
  7.  
  8. TODO:
  9.  
  10. (*) Global
  11. - Sprites priorities/clip.
  12. - Fix timing?? Foreground layer flickers during the game!!!!
  13. - hiscore.
  14.  
  15. (*) Blood Bros
  16.  
  17. (*) West Story
  18. - Sprites problems. (decode problems?)
  19.  
  20. 27.10.99:  Added sound - Bryan McPhail.
  21.  
  22. **************************************************************************/
  23.  
  24. #include "driver.h"
  25. #include "vidhrdw/generic.h"
  26. #include "cpu/z80/z80.h"
  27. #include "sndhrdw/seibu.h"
  28.  
  29. extern void bloodbro_vh_screenrefresh( struct osd_bitmap *bitmap, int fullrefresh );
  30. extern void weststry_vh_screenrefresh( struct osd_bitmap *bitmap, int fullrefresh );
  31. extern int bloodbro_vh_start(void);
  32. extern void bloodbro_vh_stop(void);
  33.  
  34. READ_HANDLER( bloodbro_background_r );
  35. WRITE_HANDLER( bloodbro_background_w );
  36. READ_HANDLER( bloodbro_foreground_r );
  37. WRITE_HANDLER( bloodbro_foreground_w );
  38.  
  39. extern unsigned char *bloodbro_videoram2;
  40. extern unsigned char *textlayoutram;
  41. extern unsigned char *bloodbro_scroll;
  42.  
  43. /***************************************************************************/
  44.  
  45. static READ_HANDLER( bloodbro_ports_r ) {
  46.      //logerror("INPUT e000[%x] \n", offset);
  47.      switch (offset) {
  48.        case 0x0: /* DIPSW 1&2 */
  49.                  return readinputport(4) + readinputport(5)*256;
  50.        case 0x2: /* IN1-IN2 */
  51.                  return readinputport(0) + readinputport(1)*256;
  52.        case 0x4: /* ???-??? */
  53.                  return readinputport(2) + readinputport(3)*256;
  54.        default: return (0xffff);
  55.      }
  56. }
  57.  
  58. static WRITE_HANDLER( bloodbro_sound_w )
  59. {
  60.     /* Slightly different interface in this game */
  61.     if (offset==0) seibu_soundlatch_w(0,data&0xff); /* Convert 16 bit write to 8 bit */
  62.     else if (offset==2) seibu_soundlatch_w(2,data&0xff); /* Convert 16 bit write to 8 bit */
  63.     else if (offset!=2) seibu_soundlatch_w(offset,data&0xff);
  64. }
  65.  
  66. READ_HANDLER( bloodbro_sound_r )
  67. {
  68.       return 0x0060; /* Always return sound cpu ready */
  69. }
  70.  
  71.  
  72. /**** Blood Bros Memory Map  *******************************************/
  73.  
  74. static struct MemoryReadAddress readmem_cpu[] = {
  75.     { 0x00000, 0x7ffff, MRA_ROM },
  76.     { 0x80000, 0x8afff, MRA_RAM },
  77.     { 0x8b000, 0x8bfff, MRA_RAM },
  78.     { 0x8c000, 0x8c3ff, bloodbro_background_r },
  79.     { 0x8c400, 0x8cfff, MRA_RAM },
  80.     { 0x8d000, 0x8d3ff, bloodbro_foreground_r },
  81.     { 0x8d400, 0x8d7ff, MRA_RAM },
  82.     { 0x8d800, 0x8dfff, MRA_RAM },
  83.     { 0x8e000, 0x8e7ff, MRA_RAM },
  84.     { 0x8e800, 0x8f7ff, paletteram_word_r },
  85.     { 0x8f800, 0x8ffff, MRA_RAM },
  86.     { 0xa0000, 0xa001f, bloodbro_sound_r },
  87.     { 0xc0000, 0xc007f, MRA_BANK3 },
  88.     { 0xe0000, 0xe000f, bloodbro_ports_r },
  89.     { -1 }
  90. };
  91.  
  92. static struct MemoryWriteAddress writemem_cpu[] = {
  93.     { 0x00000, 0x7ffff, MWA_ROM },
  94.     { 0x80000, 0x8afff, MWA_RAM },
  95.     { 0x8b000, 0x8bfff, MWA_RAM, &spriteram },
  96.     { 0x8c000, 0x8c3ff, bloodbro_background_w, &videoram },   /* Background RAM */
  97.     { 0x8c400, 0x8cfff, MWA_RAM },
  98.     { 0x8d000, 0x8d3ff, bloodbro_foreground_w, &bloodbro_videoram2 }, /* Foreground RAM */
  99.     { 0x8d400, 0x8d7ff, MWA_RAM },
  100.     { 0x8d800, 0x8dfff, MWA_RAM, &textlayoutram },
  101.     { 0x8e000, 0x8e7ff, MWA_RAM },
  102.     { 0x8e800, 0x8f7ff, paletteram_xxxxBBBBGGGGRRRR_word_w, &paletteram },
  103.     { 0x8f800, 0x8ffff, MWA_RAM },
  104.     { 0xa0000, 0xa001f, bloodbro_sound_w, &seibu_shared_sound_ram },
  105.     { 0xc0000, 0xc007f, MWA_BANK3, &bloodbro_scroll },
  106.     { 0xc0080, 0xc0081, MWA_NOP }, /* IRQ Ack VBL? */
  107.     { 0xc00c0, 0xc00c1, MWA_NOP }, /* watchdog? */
  108.     //{ 0xc0100, 0xc0100, MWA_NOP }, /* ?? Written 1 time */
  109.     { -1 }
  110. };
  111.  
  112. /**** West Story Memory Map ********************************************/
  113.  
  114. static struct MemoryReadAddress weststry_readmem_cpu[] = {
  115.     { 0x000000, 0x07ffff, MRA_ROM },
  116.     { 0x080000, 0x08afff, MRA_RAM },
  117.     { 0x08b000, 0x08bfff, MRA_RAM },
  118.     { 0x08c000, 0x08c3ff, bloodbro_background_r },
  119.     { 0x08c400, 0x08cfff, MRA_RAM },
  120.     { 0x08d000, 0x08d3ff, bloodbro_foreground_r },
  121.     { 0x08d400, 0x08dfff, MRA_RAM },
  122.     { 0x08d800, 0x08dfff, MRA_RAM },
  123.     { 0x08e000, 0x08ffff, MRA_RAM },
  124.     { 0x0c1000, 0x0c100f, bloodbro_ports_r },
  125.     { 0x0c1010, 0x0c17ff, MRA_BANK3 },
  126.     { 0x128000, 0x1287ff, paletteram_word_r },
  127.     { 0x120000, 0x128fff, MRA_BANK2 },
  128.     { -1 }
  129. };
  130.  
  131. static struct MemoryWriteAddress weststry_writemem_cpu[] = {
  132.     { 0x000000, 0x07ffff, MWA_ROM },
  133.     { 0x080000, 0x08afff, MWA_RAM },
  134.     { 0x08b000, 0x08bfff, MWA_RAM, &spriteram },
  135.     { 0x08c000, 0x08c3ff, bloodbro_background_w, &videoram },   /* Background RAM */
  136.     { 0x08c400, 0x08cfff, MWA_RAM },
  137.     { 0x08d000, 0x08d3ff, bloodbro_foreground_w, &bloodbro_videoram2 }, /* Foreground RAM */
  138.     { 0x08d400, 0x08d7ff, MWA_RAM },
  139.     { 0x08d800, 0x08dfff, MWA_RAM, &textlayoutram },
  140.     { 0x08e000, 0x08ffff, MWA_RAM },
  141.     { 0x0c1010, 0x0c17ff, MWA_BANK3 },
  142.     { 0x128000, 0x1287ff, paletteram_xxxxBBBBGGGGRRRR_word_w, &paletteram },
  143.     { 0x120000, 0x128fff, MWA_BANK2 },
  144.     { -1 }
  145. };
  146.  
  147. /******************************************************************************/
  148.  
  149. SEIBU_SOUND_SYSTEM_YM3812_MEMORY_MAP(MRA_NOP); /* No coin port in this game */
  150.  
  151. /******************************************************************************/
  152.  
  153. INPUT_PORTS_START( bloodbro )
  154.     PORT_START    /* IN0 */
  155.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY)
  156.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY)
  157.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY)
  158.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY)
  159.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  160.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
  161.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
  162.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  163.  
  164.     PORT_START    /* IN1 */
  165.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY | IPF_PLAYER2 )
  166.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_PLAYER2 )
  167.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_PLAYER2 )
  168.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  169.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  170.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  171.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER2 )
  172.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  173.  
  174.     PORT_START    /* IN */
  175.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1)
  176.     PORT_BIT( 0x0e, IP_ACTIVE_LOW, IPT_UNKNOWN )
  177.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
  178.     PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNKNOWN )
  179.  
  180.     PORT_START    /* IN */
  181.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
  182.     PORT_BIT( 0x0e, IP_ACTIVE_LOW, IPT_UNKNOWN )
  183.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
  184.     PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNKNOWN )
  185.  
  186.     PORT_START /* DSW1 */
  187.     PORT_DIPNAME( 0x01, 0x00, "Coin Mode" )
  188.     PORT_DIPSETTING(    0x00, "Normal" )
  189.     PORT_DIPSETTING(    0x01, DEF_STR( Free_Play ) )
  190.     PORT_DIPNAME( 0x06, 0x06, DEF_STR( Coin_A ) )
  191.     PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
  192.     PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
  193.     PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
  194.     PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) )
  195.     PORT_DIPNAME( 0x18, 0x18, DEF_STR( Coin_B ) )
  196.     PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) )
  197.     PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )
  198.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) )
  199.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )
  200.     PORT_DIPNAME( 0x20, 0x20, "Starting Coin" )
  201.     PORT_DIPSETTING(    0x20, "Normal" )
  202.     PORT_DIPSETTING(    0x00, "x2" )
  203.     PORT_DIPNAME( 0x40, 0x40, "Unused 1" )
  204.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  205.     PORT_DIPSETTING(    0x40, DEF_STR( On ) )
  206.     PORT_DIPNAME( 0x80, 0x80, "Unused 2" )
  207.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  208.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  209.  
  210.     PORT_START
  211.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
  212.     PORT_DIPSETTING(    0x00, "1" )
  213.     PORT_DIPSETTING(    0x02, "2" )
  214.     PORT_DIPSETTING(    0x03, "3" )
  215.     PORT_DIPSETTING(    0x01, "5" )
  216.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
  217.     PORT_DIPSETTING(    0x0c, "300K 500K" )
  218.     PORT_DIPSETTING(    0x08, "500K 500K" )
  219.     PORT_DIPSETTING(    0x04, "500K" )
  220.     PORT_DIPSETTING(    0x00, "None" )
  221.     PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
  222.     PORT_DIPSETTING(    0x20, "Easy" )
  223.     PORT_DIPSETTING(    0x30, "Normal" )
  224.     PORT_DIPSETTING(    0x10, "Hard" )
  225.     PORT_DIPSETTING(    0x00, "Very Hard" )
  226.     PORT_DIPNAME( 0x40, 0x40, "Allow Continue" )
  227.     PORT_DIPSETTING(    0x00, DEF_STR( No ) )
  228.     PORT_DIPSETTING(    0x40, DEF_STR( Yes ) )
  229.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) )
  230.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  231.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  232. INPUT_PORTS_END
  233.  
  234. /**** West Story Input Ports *******************************************/
  235.  
  236. INPUT_PORTS_START( weststry )
  237.     PORT_START    /* IN0 */
  238.         PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY)
  239.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY)
  240.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY)
  241.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY)
  242.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  243.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
  244.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
  245.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  246.  
  247.     PORT_START    /* IN1 */
  248.         PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY | IPF_PLAYER2 )
  249.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_PLAYER2 )
  250.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_PLAYER2 )
  251.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  252.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  253.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  254.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER2 )
  255.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  256.  
  257.     PORT_START    /* IN */
  258.         PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1)
  259.         PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2)
  260.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
  261.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
  262.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
  263.     PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNKNOWN )
  264.  
  265.     PORT_START    /* IN */
  266.     PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
  267. INPUT_PORTS_END
  268.  
  269.  
  270. /**** Blood Bros gfx decode ********************************************/
  271.  
  272. static struct GfxLayout textlayout = {
  273.     8,8,    /* 8*8 characters */
  274.     4096,    /* 4096 characters */
  275.     4,    /* 4 bits per pixel */
  276.     { 0, 4, 0x10000*8, 0x10000*8+4 },
  277.     { 3, 2, 1, 0, 8+3, 8+2, 8+1, 8+0},
  278.     { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
  279.     16*8    /* every char takes 16 consecutive bytes */
  280. };
  281.  
  282. static struct GfxLayout backlayout = {
  283.     16,16,    /* 16*16 sprites  */
  284.     4096,    /* 4096 sprites */
  285.     4,    /* 4 bits per pixel */
  286.     { 8, 12, 0, 4 },
  287.     { 3, 2, 1, 0, 16+3, 16+2, 16+1, 16+0,
  288.              3+32*16, 2+32*16, 1+32*16, 0+32*16, 16+3+32*16, 16+2+32*16, 16+1+32*16, 16+0+32*16 },
  289.     { 0*16, 2*16, 4*16, 6*16, 8*16, 10*16, 12*16, 14*16,
  290.             16*16, 18*16, 20*16, 22*16, 24*16, 26*16, 28*16, 30*16 },
  291.     128*8    /* every sprite takes 128 consecutive bytes */
  292. };
  293.  
  294. static struct GfxLayout spritelayout = {
  295.     16,16,    /* 16*16 sprites  */
  296.     8192,    /* 8192 sprites */
  297.     4,    /* 4 bits per pixel */
  298.     { 8, 12, 0, 4 },
  299.     { 3, 2, 1, 0, 16+3, 16+2, 16+1, 16+0,
  300.              3+32*16, 2+32*16, 1+32*16, 0+32*16, 16+3+32*16, 16+2+32*16, 16+1+32*16, 16+0+32*16 },
  301.     { 0*16, 2*16, 4*16, 6*16, 8*16, 10*16, 12*16, 14*16,
  302.             16*16, 18*16, 20*16, 22*16, 24*16, 26*16, 28*16, 30*16 },
  303.     128*8    /* every sprite takes 128 consecutive bytes */
  304. };
  305.  
  306. static struct GfxDecodeInfo bloodbro_gfxdecodeinfo[] =
  307. {
  308.     { REGION_GFX1, 0x00000, &textlayout,   0x70*16,  0x10 }, /* Text */
  309.     { REGION_GFX2, 0x00000, &backlayout,   0x40*16,  0x10 }, /* Background */
  310.     { REGION_GFX2, 0x80000, &backlayout,   0x50*16,  0x10 }, /* Foreground */
  311.     { REGION_GFX3, 0x00000, &spritelayout, 0x00*16,  0x10 }, /* Sprites */
  312.     { -1 }
  313. };
  314.  
  315. /**** West Story gfx decode *********************************************/
  316.  
  317. static struct GfxLayout weststry_textlayout = {
  318.     8,8,    /* 8*8 sprites */
  319.     4096,    /* 4096 sprites */
  320.     4,    /* 4 bits per pixel */
  321.     { 0, 0x8000*8, 2*0x8000*8, 3*0x8000*8 },
  322.         { 0, 1, 2, 3, 4, 5, 6, 7 },
  323.         { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  324.     8*8    /* every sprite takes 8 consecutive bytes */
  325. };
  326.  
  327. static struct GfxLayout weststry_backlayout = {
  328.     16,16,    /* 16*16 sprites */
  329.     4096,    /* 4096 sprites */
  330.     4,    /* 4 bits per pixel */
  331.     { 0*0x20000*8, 1*0x20000*8, 2*0x20000*8, 3*0x20000*8 },
  332.     { 0, 1, 2, 3, 4, 5, 6, 7,
  333.              16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7},
  334.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  335.             8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
  336.     32*8    /* every sprite takes 32 consecutive bytes */
  337. };
  338.  
  339. static struct GfxLayout weststry_spritelayout = {
  340.     16,16,    /* 16*16 sprites */
  341.     8192,    /* 8192 sprites */
  342.     4,    /* 4 bits per pixel */
  343.     { 0*0x40000*8, 1*0x40000*8, 2*0x40000*8, 3*0x40000*8 },
  344.     { 0, 1, 2, 3, 4, 5, 6, 7,
  345.              16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7 },
  346.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  347.             8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
  348.     32*8    /* every sprite takes 32 consecutive bytes */
  349. };
  350.  
  351. static struct GfxDecodeInfo weststry_gfxdecodeinfo[] =
  352. {
  353.     { REGION_GFX1, 0x00000, &weststry_textlayout,     16*16,  0x10 },
  354.     { REGION_GFX2, 0x00000, &weststry_backlayout,     48*16,  0x10 },
  355.     { REGION_GFX2, 0x80000, &weststry_backlayout,     32*16,  0x10 },
  356.     { REGION_GFX3, 0x00000, &weststry_spritelayout,    0*16,  0x10 },
  357.     { -1 }
  358. };
  359.  
  360. /**** Blood Bros Interrupt & Driver Machine  ****************************/
  361.  
  362. /* Parameters: YM3812 frequency, Oki frequency, Oki memory region */
  363. SEIBU_SOUND_SYSTEM_YM3812_HARDWARE(14318180/4,8000,REGION_SOUND1);
  364.  
  365. static struct MachineDriver machine_driver_bloodbro =
  366. {
  367.     {
  368.         {
  369.             CPU_M68000,
  370.             10000000, /* 10 Mhz */
  371.             readmem_cpu,writemem_cpu,0,0,
  372.             m68_level4_irq,1
  373.         },
  374.         {
  375.             SEIBU_SOUND_SYSTEM_CPU(14318180/4)
  376.         },
  377.     },
  378.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,
  379.     1,    /* CPU slices per frame */
  380.     seibu_sound_init_1, /* init machine */
  381.  
  382.     /* video hardware */
  383.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  384.     bloodbro_gfxdecodeinfo,
  385.     2048,2048,
  386.     0,
  387.  
  388.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  389.  
  390.     0,
  391.     bloodbro_vh_start,
  392.     bloodbro_vh_stop,
  393.     bloodbro_vh_screenrefresh,
  394.  
  395.     /* sound hardware */
  396.     0,0,0,0,
  397.     {
  398.         SEIBU_SOUND_SYSTEM_YM3812_INTERFACE
  399.     }
  400. };
  401.  
  402. static struct MachineDriver machine_driver_weststry =
  403. {
  404.     {
  405.         {
  406.             CPU_M68000,
  407.             10000000, /* 10 Mhz */
  408.             weststry_readmem_cpu,weststry_writemem_cpu,0,0,
  409.             m68_level6_irq,1
  410.         },
  411.         {
  412.             SEIBU_SOUND_SYSTEM_CPU(14318180/4)
  413.         },
  414.     },
  415.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,
  416.     1,    /* CPU slices per frame */
  417.     seibu_sound_init_1, /* init machine */
  418.  
  419.     /* video hardware */
  420.     256, 256, { 0, 255, 16, 239 },
  421.  
  422.     weststry_gfxdecodeinfo,
  423.         1024,1024,
  424.         0,
  425.  
  426.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  427.  
  428.     0,
  429.         bloodbro_vh_start,
  430.         bloodbro_vh_stop,
  431.     weststry_vh_screenrefresh,
  432.  
  433.     /* sound hardware */
  434.     0,0,0,0,
  435.     {
  436.         SEIBU_SOUND_SYSTEM_YM3812_INTERFACE
  437.     }
  438. };
  439.  
  440.  
  441.  
  442. ROM_START( bloodbro )
  443.     ROM_REGION( 0x90000, REGION_CPU1 )
  444.     ROM_LOAD_ODD ( "bb_02.bin" ,   0x00000, 0x20000, 0xc0fdc3e4 )
  445.     ROM_LOAD_EVEN( "bb_01.bin" ,   0x00000, 0x20000, 0x2d7e0fdf )
  446.     ROM_LOAD_ODD ( "bb_04.bin" ,   0x40000, 0x20000, 0xfd951c2c )
  447.     ROM_LOAD_EVEN( "bb_03.bin" ,   0x40000, 0x20000, 0x18d3c460 )
  448.  
  449.     ROM_REGION( 0x18000, REGION_CPU2 )
  450.     ROM_LOAD( "bb_07.bin" ,   0x000000, 0x08000, 0x411b94e8 )
  451.     ROM_CONTINUE(             0x010000, 0x08000 )
  452.  
  453.     ROM_REGION( 0x20000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  454.     ROM_LOAD( "bb_05.bin" ,   0x00000, 0x10000, 0x04ba6d19 )    /* characters */
  455.     ROM_LOAD( "bb_06.bin" ,   0x10000, 0x10000, 0x7092e35b )
  456.  
  457.     ROM_REGION( 0x100000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  458.     ROM_LOAD( "bloodb.bk",   0x00000, 0x100000, 0x1aa87ee6 )    /* Background+Foreground */
  459.  
  460.     ROM_REGION( 0x100000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  461.     ROM_LOAD( "bloodb.obj",   0x00000, 0x100000, 0xd27c3952 )    /* sprites */
  462.  
  463.     ROM_REGION( 0x20000, REGION_SOUND1 )    /* ADPCM samples */
  464.     ROM_LOAD( "bb_08.bin" ,   0x00000, 0x20000, 0xdeb1b975 )
  465. ROM_END
  466.  
  467. ROM_START( weststry )
  468.     ROM_REGION( 0x90000, REGION_CPU1 )    /* 64k for cpu code */
  469.     ROM_LOAD_ODD ( "ws13.bin" ,   0x00000, 0x20000, 0x158e302a )
  470.     ROM_LOAD_EVEN( "ws15.bin" ,   0x00000, 0x20000, 0x672e9027 )
  471.     ROM_LOAD_ODD ( "bb_04.bin" ,   0x40000, 0x20000, 0xfd951c2c )
  472.     ROM_LOAD_EVEN( "bb_03.bin" ,   0x40000, 0x20000, 0x18d3c460 )
  473.  
  474.     ROM_REGION( 0x18000, REGION_CPU2 )    /* 64k for sound cpu code */
  475.     ROM_LOAD( "ws17.bin" ,   0x000000, 0x08000, 0xe00a8f09 )
  476.     ROM_CONTINUE(            0x010000, 0x08000 )
  477.  
  478.     ROM_REGION( 0x20000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  479.     ROM_LOAD( "ws09.bin" ,   0x00000, 0x08000, 0xf05b2b3e )    /* characters */
  480.     ROM_CONTINUE(            0x00000, 0x8000 )
  481.     ROM_LOAD( "ws11.bin" ,   0x08000, 0x08000, 0x2b10e3d2 )
  482.     ROM_CONTINUE(            0x08000, 0x8000 )
  483.     ROM_LOAD( "ws10.bin" ,   0x10000, 0x08000, 0xefdf7c82 )
  484.     ROM_CONTINUE(            0x10000, 0x8000 )
  485.     ROM_LOAD( "ws12.bin" ,   0x18000, 0x08000, 0xaf993578 )
  486.     ROM_CONTINUE(            0x18000, 0x8000 )
  487.  
  488.     ROM_REGION( 0x100000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  489.     ROM_LOAD( "ws05.bin" ,   0x00000, 0x20000, 0x007c8dc0 )    /* Background */
  490.     ROM_LOAD( "ws07.bin" ,   0x20000, 0x20000, 0x0f0c8d9a )
  491.     ROM_LOAD( "ws06.bin" ,   0x40000, 0x20000, 0x459d075e )
  492.     ROM_LOAD( "ws08.bin" ,   0x60000, 0x20000, 0x4d6783b3 )
  493.     ROM_LOAD( "ws01.bin" ,   0x80000, 0x20000, 0x32bda4bc )    /* Foreground */
  494.     ROM_LOAD( "ws03.bin" ,   0xa0000, 0x20000, 0x046b51f8 )
  495.     ROM_LOAD( "ws02.bin" ,   0xc0000, 0x20000, 0xed9d682e )
  496.     ROM_LOAD( "ws04.bin" ,   0xe0000, 0x20000, 0x75f082e5 )
  497.  
  498.     ROM_REGION( 0x100000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  499.     ROM_LOAD( "ws25.bin" ,   0x00000, 0x20000, 0x8092e8e9 )    /* sprites */
  500.     ROM_LOAD( "ws26.bin" ,   0x20000, 0x20000, 0xf6a1f42c )
  501.     ROM_LOAD( "ws23.bin" ,   0x40000, 0x20000, 0x43d58e24 )
  502.     ROM_LOAD( "ws24.bin" ,   0x60000, 0x20000, 0x20a867ea )
  503.     ROM_LOAD( "ws21.bin" ,   0x80000, 0x20000, 0xe23d7296 )
  504.     ROM_LOAD( "ws22.bin" ,   0xa0000, 0x20000, 0x7150a060 )
  505.     ROM_LOAD( "ws19.bin" ,   0xc0000, 0x20000, 0xc5dd0a96 )
  506.     ROM_LOAD( "ws20.bin" ,   0xe0000, 0x20000, 0xf1245c16 )
  507.  
  508.     ROM_REGION( 0x20000, REGION_SOUND1 )    /* ADPCM samples */
  509.     ROM_LOAD( "bb_08.bin" ,   0x00000, 0x20000, 0xdeb1b975 )
  510. ROM_END
  511.  
  512. static void gfx_untangle( void )
  513. {
  514.     unsigned char *gfx = memory_region(REGION_GFX3);
  515.     int i;
  516.     for( i=0; i< 0x100000; i++ ){
  517.         gfx[i] = ~gfx[i];
  518.     }
  519. }
  520.  
  521. /***************************************************************************/
  522.  
  523. static void init_bloodbro(void)
  524. {
  525.     install_seibu_sound_speedup(1);
  526. }
  527.  
  528. static void init_weststry(void)
  529. {
  530.     install_seibu_sound_speedup(1);
  531.     gfx_untangle();
  532. }
  533.  
  534. /***************************************************************************/
  535.  
  536. GAME( 1990, bloodbro, 0,        bloodbro, bloodbro, bloodbro, ROT0, "Tad", "Blood Bros." )
  537. GAME( 1990, weststry, bloodbro, weststry, weststry, weststry, ROT0, "bootleg", "West Story" )
  538.